<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class Pet extends Model
{
	use HasDateTimeFormatter;



    public function setHealthAttribute($value)
    {
        $this->attributes['health'] = json_encode($value);
    }
    public function setAlbumAttribute($value)
    {
        $this->attributes['album'] = json_encode($value);
    }
    public function getHealthAttribute($value)
    {
        return json_decode($value,true);
    }
    public function getAlbumAttribute($value)
    {
        $data= json_decode($value,true);
        return array_map(function ($item){
           return createFullUrl($item);
        },$data);
    }
}
